<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/commons/taglibs.jsp" %>

<form id="pagesetting_formId" action="userSetting/update.do" method="post">
	<div class="con_wrap_padding"><div class="spacing"></div>
	<table class="form-table">
		<thead>
        <td colspan="2" align="center"> 个性化设置</td>
        </thead>
		<tr>
			<th><span class="note_red">*</span>每页条数：</th>
			<td><input name="hideinput" style="display:none;"/> 
				<input title="请输入每页条数" name="pageSize" type="text" class="form-txtinput" value="${pageSize}" maxlength="2">
			</td>
		</tr>
		<tr>
			<th><span class="note_red">*</span>动画效果：</th>
			<td>
				<input name="animateEff" type="radio" class="form-txtinput" value="1" ${animateEff == 1?'checked="true"':''}><span>开启</span>
				&nbsp;
				<input name="animateEff" type="radio" class="form-txtinput" value="0" ${animateEff == 0?'checked="true"':''}>关闭
			</td>
		</tr>
		<tr>
			<th><span class="note_red">*</span>自动锁屏时间：</th>
			<td>
				<s:select list="#{'0':'从不','10':'10分钟','30':'30分钟','60':'1小时','120':'2小时'}" name="lockScreenTime"></s:select>
			</td>
		</tr>	
	</table>
	<div class="win-btn-panel">
	    <a class="btn_short" href="javascript:void(0)" onClick="PageSettingUtils.submitForm()">确 定</a>
	</div></div>
</form>
<script>
var animateEff = Milan.commonutils.getCookie("animateEff");
if (animateEff)
{
	if (animateEff=="1")
	{
		jQuery("input[name='animateEff'][value='1']").attr("checked",true);
	}
	else
	{
		jQuery("input[name='animateEff'][value='0']").attr("checked",true);
	}
}
	
PageSettingUtils = new Object();
PageSettingUtils.submitForm = function() 
{

	var animateEff = jQuery("input[name='animateEff']:checked").val();
	if (animateEff)
	{
		if (animateEff=="1")
		{
			Milan.commonutils.MODELPOP_ANIMATESHOW = true;
			Milan.commonutils.MODELPOP_ANIMATECLOSE = true;
		}
		else
		{
			Milan.commonutils.MODELPOP_ANIMATESHOW = false;
			Milan.commonutils.MODELPOP_ANIMATECLOSE = false;
		}
		Milan.commonutils.setCookie("animateEff",animateEff,999);
	}

	
	Milan.lockScreen_time=parseInt($("pagesetting_formId").lockScreenTime.value);
	var pageSize = jQuery("#pagesetting_formId").find("input[name='pageSize']").val();
	if(isNaN(pageSize)){
		Milan.commonutils.createDelayNotifyModel("提示信息", "每页条数必须是数字！");
		return;
	}
	if (pageSize<=0)
	{
		Milan.commonutils.createDelayNotifyModel("提示信息", "每页条数必须大于0！");
		return;
	}
	Milan.ajaxutility.formSubmit({
		form:"pagesetting_formId",
		success:function(response)
		{
		
		}
	});
}

</script>